package com.czxy.demo01;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Test16 {
    public static void main(String[] args) {
        System.out.println(getYesterdayTime());
    }
    public static String getYesterdayTime( ){
        Date d = new Date();
        d.setDate(d.getDate()-1);
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH-mm-SS");
        String format = df.format(d);
        return format;
    }
}
